<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>公告管理(生产企业端)</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>  
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
                            
    <section class="content-header">
        <h1>招标公告查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">药品招标管理</a></li>
            <li class="active"><a href="#">招标公告查看</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                        <label for="sysNoticeTitle">公告标题：</label>
                        <input class="form-control" type="text" id="Title" name="noticeTitle" placeholder="公告标题" maxlength="100" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="sysNoticeDateTime">发布日期：</label>
                        <input class="form-control" type="text" id="Start" name="startDate" placeholder="开始日期"  data-date-fmt="yyyy-MM-dd"
                        onFocus="var endDate=$dp.$('End');WdatePicker({maxDate:'#F{$dp.$D(\'End\')}'})" />
                        <label>-</label>
                        <input class="form-control" type="text" id="End" name="endDate" placeholder="结束日期"  data-date-fmt="yyyy-MM-dd" 
                        onFocus="WdatePicker({minDate:'#F{$dp.$D(\'Start\')}'})"  />
                    </div>
                    <button type="button" class="btn btn-success btn-sm" onclick="search();">查询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
  
    </section>
     <%@ include file="/WEB-INF/component/commonJS.jsp" %>  
    <script type="text/javascript">
    
        function search(page) {
            var NoticeTitle = $.trim($("#Title").val());
            var StartDate = $.trim($("#Start").val());
            var EndDate = $.trim($("#End").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{
                	"noticeTitle":NoticeTitle,
                    "startDate":StartDate, 
                	"endDate":EndDate
                	},
                page : (page || 1)
            }).trigger("reloadGrid"); //重新载入  
        }
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/prodNotice/getNoticeList.html",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                height: 270,
                colNames: [
                    '操作',
                    '公告标题',
                    '项目名称',
                    '发布机构',
                    '阅读次数',
                    '发布日期'
                ],
                colModel: [
					{ name: 'operate', width: 80, align:"center", sortable: false,
					    formatter : function(val, opts, rowdata) {
					        var str =  " ";
					        str += "<a href='${ctx}/prodNotice/toNoticeDetail.html?noticeId=" + rowdata.noticeId + "'>详情</a>";
					        return str;
					}},
                    { name: 'title', width: 180, align:"left", sortable: false},
                    { name: 'projName', width: 180, align:"left", sortable: false},
                    { name: 'org',width: 140, align:"center", sortable: false},
                    { name: 'readCount', hidden:true, width: 40, align:"center", sortable: false },
                    { name: 'datetime', width: 140, align:"center", sortable: false }
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: true, 
                viewrecords: true,
                caption: "招标公告列表",
                jsonReader: {
                    id: "noticeId"
                }
            });
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $(window).trigger("resize");
            
        });
    </script>
</body>
</html>












